package edu.chalmers.mde.schedulesystem;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;



public class BufferedReaderTest {
	
 	public static void main(String[] args)  throws IOException {
 			
 		
 			FileWriter fw = new FileWriter("c:/myDoc/Acceleo.txt");
			BufferedWriter bw = new BufferedWriter(fw);
			
				
		
			
			bw.write("Stockholm -> 12:00");
			bw.write("Goteborg -> 16:00");
			bw.newLine();
			bw.write("Goteborg -> 9:00");
			bw.write("Kiruna -> 11:00");
			System.out.println("copy in progress.....");
			System.out.println("end copy.. ");
			bw.flush();
			bw.close();
			fw.close();
			
			FileReader fr = new FileReader("c:/myDoc/Acceleo.txt");
			BufferedReader br = new BufferedReader(fr);
			FileWriter fw2 = new FileWriter("c:/myDoc/s2.txt");
			BufferedWriter bw2 = new BufferedWriter(fw2);
			while(br.ready()){
				bw2.write(br.readLine());
				bw2.newLine();
			}
			bw2.close();
			fw2.close();
			fr.close();
			br.close();
 	}

}
